package com.yqya.springboot.shiro.practice.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.yqya.springboot.shiro.practice.biz.RoleInfoBizService;
import com.yqya.springboot.shiro.practice.domain.RoleInfo;
import com.yqya.springboot.shiro.practice.dto.RoleInfoDTO;

/**
 * 角色信息
 *
 * @author Kevin
 * @date 2019-07-28
 */
@RestController
@RequestMapping("/role")
public class RoleInfoController {

    @Autowired
    private RoleInfoBizService roleInfoBizService;

    /**
     * 添加角色
     *
     * @param dto
     * @return
     */
    @PostMapping(value = "/")
    public String saveRoleInfo(@RequestBody RoleInfoDTO dto) {
        RoleInfo item = roleInfoBizService.save(dto);
        return "添加角色成功 \n" + item;
    }

}
